from django.contrib import admin
from .models import AddProject,ProjectList,WorkLoad,Opinion,ReportList,Postion,Category,ServiceClass,Stage,Result,WorkFlow,WorkFlowLog
# Register your models here.
class PostionAdmin(admin.ModelAdmin):
    list_display = ['project','piont','desc']
    search_fields = ['project','piont','desc']
admin.site.register(Postion,PostionAdmin)

class CategoryAdmin(admin.ModelAdmin):
    list_display = ['name', 'desc', 'is_root','parent','is_abort','sort']
    search_fields = ['name', 'desc', 'is_root','parent','is_abort','sort']
admin.site.register(Category,CategoryAdmin)

class ServiceClassAdmin(admin.ModelAdmin):
    list_display = ['name', 'desc', 'is_root','parent','is_abort','sort']
    search_fields = ['name', 'desc', 'is_root','parent','is_abort','sort']

admin.site.register(ServiceClass,ServiceClassAdmin)

class StageAdmin(admin.ModelAdmin):
    list_display = ['name', 'desc', 'sort']
    search_fields = ['name', 'desc', 'sort']

admin.site.register(Stage,StageAdmin)

class ResultAdmin(admin.ModelAdmin):
    list_display = ['name', 'sort']
    search_fields = ['name', 'sort']

admin.site.register(Result,ResultAdmin)

class WorkFlowAdmin(admin.ModelAdmin):
    list_display = ['name', 'sort']
    search_fields = ['name', 'sort']

admin.site.register(WorkFlow,WorkFlowAdmin)

class WorkFlowLogAdmin(admin.ModelAdmin):
    list_display = ['name', 'desc']
    search_fields = ['name', 'desc']

admin.site.register(WorkFlowLog,WorkFlowLogAdmin)

class AddProjectAdmin(admin.ModelAdmin):
    list_display = ['tempname', 'category','serviceclass','add_no','company','isSign','isDo']

admin.site.register(AddProject,AddProjectAdmin)

class ProjectListAdmin(admin.ModelAdmin):
    list_display = ['projectname','projectno','sz_get_no','resultclass','stage','status','p_finishtime','userOperate','sz_geology_cost_file']
    list_editable = ['projectno','sz_get_no','resultclass','stage','status','p_finishtime','sz_geology_cost_file']
admin.site.register(ProjectList,ProjectListAdmin)